package com.trkj.property_controller;

import com.trkj.entity.OrderWorkEntity;
import com.trkj.entity.UserEntity;
import com.trkj.entity.ZongEntity;
import com.trkj.service.OrderWorkService;
import com.trkj.vo.AjaxResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Slf4j
@CrossOrigin
public class OrderWorkController {
    @Resource
    private OrderWorkService orderWorkService;
    @PostMapping("OrderWorkList")
    public AjaxResponse OrderWorkList(@RequestBody OrderWorkEntity orderWorkEntity, @RequestParam("currentPage")int currentPage, @RequestParam("pageSize")int pageSize){
        return AjaxResponse.success(orderWorkService.OrderWorkList(orderWorkEntity,currentPage,pageSize));
    }
    @PostMapping("GongDanDetail/{id}")
    public AjaxResponse GongDanDetail(@PathVariable("id") String bianhao){
        return AjaxResponse.success(orderWorkService.GongDanDetail(bianhao));
    }
    @PostMapping("/CaoZuoGongDanDetail")
    public AjaxResponse CaoZuoGongDanDetail(@RequestBody OrderWorkEntity orderWorkEntity){
        return AjaxResponse.success(orderWorkService.CaoZuoGongDanDetail(orderWorkEntity));
    }
    @PostMapping("/findOrderNum")
    public List<OrderWorkEntity> findOrderNum(){
        return orderWorkService.findOrderNum();
    }
    @PostMapping("/countOrder")
    public List<OrderWorkEntity> countOrder(){
        return orderWorkService.countOrder();
    }
    @PostMapping("/OrderLX")
    public AjaxResponse OrderLX(){
        return AjaxResponse.success(orderWorkService.OrderLX());
    }
    @PostMapping("/Orderwork")
    public AjaxResponse Orderwork(@RequestBody OrderWorkEntity orderWorkEntity){
        return AjaxResponse.success(orderWorkService.Orderwork(orderWorkEntity));
    }
    @PostMapping("/addOrderWork")
    public AjaxResponse addOrderWork(@RequestBody OrderWorkEntity orderWorkEntity){
        return AjaxResponse.success(orderWorkService.addOrderWork(orderWorkEntity));
    }
    @PostMapping("/orderfindAll")
    public AjaxResponse orderfindAll(){
        return AjaxResponse.success(orderWorkService.orderfindAll());
    }
    @PostMapping("/findAll1")
    public  AjaxResponse findAll1(@RequestBody ZongEntity zongEntity){
        log.debug("123{}",zongEntity);
        return AjaxResponse.success(orderWorkService.findAll1(zongEntity));
    }
    @PostMapping("/findOrderNum1")
    public List<OrderWorkEntity> findOrderNum1(){
        return orderWorkService.findOrderNum1();
    }
    @PostMapping("/findOrderZB")
    public List<OrderWorkEntity> findOrderZB(){
        return orderWorkService.findOrderZB();
    }
    @PostMapping("/ChaAdressFenBu")
    public AjaxResponse ChaAdressFenBu(){
        return AjaxResponse.success(orderWorkService.ChaAdressFenBu());
    }
}
